package com.lyb.lmvp.demo;


import com.lyb.mvp.core.LPresent;
import com.lyb.mvp.net.ApiSubscriber;
import com.lyb.mvp.net.NetError;

import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;

public class PMulti extends LPresent<ICommonV> {

    public void loadData() {

        ServiceFactory.getGankService().getGankData("",10,10)
            .subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(new ApiSubscriber<GankResults>() {
                @Override
                protected void onFail(NetError error) {
                    getV().showError(error);
                }

                @Override
                public void onNext(GankResults gankResults) {
                    getV().showOk();

                }
            })
        ;

    }
}
